<!-- 模板 -->
<template>
    <div class="pop" v-show="show">
        <transition :name="maskerTransition">
            <div class="pop__masker" v-show="isComponentShow" @click="onHide"></div>
        </transition>
        <div class="pop__inner">
            <transition :name="dialogTransition" v-on:after-leave="afterLeave">
                <div class="pop__inner__dialog" v-show='isComponentShow'>
                    <div class="sign_success">
                        <i class="aui-icon aui-icon--check"></i>
                        <label>报名成功</label>
                    </div>
                    <a href="javascript:;" @click="onHide" class="pop-close"></a>
                </div>
            </transition>
        </div>
    </div>
</template>


<!-- js -->
<script>
    export default{
       data(){
            return{
                show: !1,
                isComponentShow: !1,
                maskerTransition: "aui-pop-masker",
                dialogTransition: "aui-pop"
            }
        },
        props: {
            isShow: {
                type: Boolean,
                default: !1
            }
        },
        watch: {
            isShow(){
                if(!this.isShow){
                    this.onHide();
                    return;
                }
                this.show = 1;

                setTimeout(() => {
                    this.isComponentShow = !0;
                }, 10);
            }
        },
        methods: {
            onHide() {
                this.isComponentShow = !1;
            },
            // 点击确认按钮之后，可能会存在回调事件
            afterLeave(){
                this.show = !1;
                // 回调
                this.$emit('on-cb');
            }
        }
    }
</script>

<!-- scss -->
<style scoped lang="scss">
@import "../../styles/views/pop.scss";
.pop-close{
    width: 0.6rem;
    height: 0.6rem;
    display: block;
    position: absolute;
    bottom: 0.1rem;
    left: 50%;
    margin-left: -0.3rem;
    background: url("../../assets/images/icon_close.png") 50% no-repeat;
    background-size: 0.6rem; 
    &:active{
        transform: scale(1.1);
    }
}
.pop__inner__dialog{
    position: relative;
    overflow: hidden;
    width: 5rem;
    color: #fff;
    padding-bottom:1.8rem;
    pointer-events: auto;
}
.sign_success{
    width: 5.0rem;
    height: 4.3rem;
    background: url("../../assets/images/pop_sign_bg.jpg") 50% no-repeat;
    background-size: cover;
    padding-top: 0.1rem;
    text-align: center;
    font-size: 0.36rem;
    color: #fff;
    border-radius: 5px;
    overflow: hidden;
    .aui-icon--check{
        font-size: 1.8rem;
        font-weight: bold;
        line-height: 1.6rem;
    }
    &:after{
        width: 5.0rem;
        height: 1.9rem;
        position: absolute;
        bottom: 1.75rem;
        left: 0;
        background: url("../../assets/images/pop_sign_car.png") 0 0 no-repeat;
        background-size: cover;
        content: "";
    }
    >label{
        display: block;
        text-align: center;
    }
}
</style>
